#include "includes.h"


unsigned long int num;


/*****************************************************************************
Name:          Delay
Description:    Delay program for ...ms
Parameters:    ms
Returns:        none
*****************************************************************************/
void Delay(int ms)
{
  int i;

  for (i=0;i<ms;i++)
      _delay_ms(1);
}

void adc2lcd(void)
{


	
	
	adc_init(0x00);
    afiseaza_adc();  
	
	
	//lcd_puts("  ");
	//read_temperature();	
	
	
	lcd_gotoxy(x_temp,y_temp);
	adc_init(0x01);
	afiseaza_adc();
	
	//lcd_puts("  ");
	//read_temperature();	
	
	Delay(1000);
}


int main(void){
	
	
	
	char i='0';
	lcd_init(LCD_DISP_ON_CURSOR_BLINK);
    lcd_clrscr();
	PORTC=0xff;
	DDRC=0xFB;
	
	PORTA=0x00;	
    while(1){
	
		if(!(PINC&0x04))
		{
		lcd_clrscr();
		if(y_temp==0) y_temp=1;
			else y_temp = 0;
		lcd_gotoxy(x_temp,y_temp);
		adc_init(0x01);
		afiseaza_adc();
		
		
		if(y_temp==1) y_temp=0;
			else y_temp = 1;
		lcd_gotoxy(x_temp,y_temp);
		lcd_putc(i);
		i++;
		
		
		}
    }
    return 0;
}
